/*
 *  Copyright (C) 2010 {Apertum}Projects. web: www.apertum.ru email: info@apertum.ru
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package ru.apertum.qsystem.client.forms;

import org.dom4j.Element;
import org.dom4j.Node;
import org.dom4j.tree.DefaultElement;
import org.jdesktop.application.Application;
import org.jdesktop.application.ResourceMap;
import ru.apertum.qsystem.QSystem;
import ru.apertum.qsystem.common.NetCommander;
import ru.apertum.qsystem.common.RunningLabel;
import ru.apertum.qsystem.common.Uses;
import ru.apertum.qsystem.common.model.INetProperty;
import ru.apertum.qsystem.server.board.Board;

import javax.swing.AbstractAction;
import javax.swing.GroupLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JColorChooser;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JSpinner;
import javax.swing.JTabbedPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.JToggleButton;
import javax.swing.LayoutStyle;
import javax.swing.SpinnerNumberModel;
import javax.swing.SwingConstants;
import javax.swing.WindowConstants;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.Color;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.LayoutManager;
import java.awt.event.ActionEvent;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.util.ResourceBundle;

/**
 * Created on 14 Апрель 2009 г., 18:01.
 *
 * @author Evgeniy Egorov
 */
@SuppressWarnings({"squid:S1192", "squid:S1172", "squid:S1450", "squid:S1604", "squid:S1161", "squid:MaximumInheritanceDepth"})
public class FBoardParams extends javax.swing.JDialog {

    private static ResourceMap localeMap = null;

    private static String getLocaleMessage(String key) {
        if (localeMap == null) {
            localeMap = Application.getInstance(QSystem.class).getContext().getResourceMap(FBoardParams.class);
        }
        return localeMap.getString(key);
    }

    /**
     * Используемая ссылка на диалоговое окно.
     */
    private static FBoardParams boardParams;
    final transient INetProperty netProps;

    /**
     * Creates new form FBoardParams.
     *
     * @param parent относительно чего модальна форма
     * @param modal  модальна или нет
     */
    public FBoardParams(java.awt.Frame parent, boolean modal, INetProperty netProps) {
        super(parent, modal);
        this.netProps = netProps;
        initComponents();
        runningLabel.setRunningText("");
        htmlLabel.setRunningText("");
        dateLabel.setRunningText("");

        buttonOk.addActionListener(e -> {
            // изменить переданые параметры
            saveXML();
            setVisible(false);
        });
        buttonCancel.addActionListener(e -> setVisible(false));

        spinnerFontSize.getModel().addChangeListener(e -> {
            final Font fnt = new Font(runningLabel.getFont().getName(), runningLabel.getFont().getStyle(), (Integer) spinnerFontSize.getValue());
            runningLabel.setFont(fnt);
            htmlLabel.setFont(fnt);
            dateLabel.setFont(fnt);
        });
        textFieldFontColor.addKeyListener(new KeyListener() {

            @Override
            public void keyTyped(KeyEvent e) {
                runningLabel.setForeground(Color.decode("#" + textFieldFontColor.getText()));
                dateLabel.setForeground(Color.decode("#" + textFieldFontColor.getText()));
                htmlLabel.setForeground(Color.decode("#" + textFieldFontColor.getText()));
            }

            @Override
            public void keyPressed(KeyEvent e) {
                //runningLabel.setForeground(Color.decode(textFieldFontColor.getText()))
            }

            @Override
            public void keyReleased(KeyEvent e) {
                //runningLabel.setForeground(Color.decode(textFieldFontColor.getText()))
            }
        });
        spinnerSpeed.getModel().addChangeListener(new ChangeListener() {

            @Override
            public void stateChanged(ChangeEvent e) {
                runningLabel.setSpeedRunningText((Integer) spinnerSpeed.getValue());
            }
        });
    }

    /**
     * Выбор параметров для части общего табло.
     *
     * @param owner   относительно этого контрола модальность и позиционирование
     * @param params  XML для редактирования.
     * @param caption заголовок диалога.
     */
    public static void changeParams(JFrame owner, Element params, String caption, INetProperty netProps) {
        if (boardParams == null) {
            boardParams = new FBoardParams(owner, true, netProps);
        }
        Uses.setLocation(boardParams);
        boardParams.loadXML(params);
        boardParams.setTitle(caption);
        boardParams.setVisible(true);
    }

    /**
     * Выбор параметров для части общего табло.
     *
     * @param owner   относительно этого контрола модальность и позиционирование
     * @param segment pojo с настройками для редактирования.
     * @param caption заголовок диалога.
     */
    public static void changeParams(JFrame owner, Board.Segment segment, String caption, INetProperty netProps) {
        if (boardParams == null) {
            boardParams = new FBoardParams(owner, true, netProps);
        }
        Uses.setLocation(boardParams);
        boardParams.loadSegment(segment);
        boardParams.setTitle(caption);
        boardParams.setVisible(true);
    }

    /**
     * Ветка XML-параметров.
     */
    private transient Element params = null;
    private transient Board.Segment segment = null;

    private void loadSegment(Board.Segment segment) {
        this.segment = segment;
        if (segment.fractal.isEmpty()) {
            tfFRactal.setText("Do not touch this!");
        } else {
            tfFRactal.setText(segment.fractal);
        }
        textFieldRunning.setText(segment.runningText);
        textAreaHtml.setText(segment.content.trim());
        runningLabel.setRunningText(textFieldRunning.getText());
        htmlLabel.setText(textAreaHtml.getText().trim());
        textFieldPict.setText(segment.backgroundImg);
        textFieldVideo.setText(segment.videoFile);
        spinnerFontSize.setValue(segment.font.getSize());
        textFieldFontColor.setText(Integer.toHexString(segment.fontColor.getRGB()).substring(2));
        runningLabel.setFont(new Font(runningLabel.getFont().getFontName(), runningLabel.getFont().getStyle(), (Integer) spinnerFontSize.getValue()));
        runningLabel.setForeground(Color.decode("#" + textFieldFontColor.getText()));
        htmlLabel.setFont(new Font(runningLabel.getFont().getFontName(), runningLabel.getFont().getStyle(), (Integer) spinnerFontSize.getValue()));
        htmlLabel.setForeground(Color.decode("#" + textFieldFontColor.getText()));
        dateLabel.setFont(new Font(runningLabel.getFont().getFontName(), runningLabel.getFont().getStyle(), (Integer) spinnerFontSize.getValue()));
        dateLabel.setForeground(Color.decode("#" + textFieldFontColor.getText()));
        spinnerSpeed.setValue(segment.speedRunningText);
        runningLabel.setSpeedRunningText((Integer) spinnerSpeed.getValue());
        checkBoxDate.setSelected(segment.simpleDate);
        checkBoxGridNext.setSelected(segment.nextTable.visible);
        spinnerGridNextCols.setValue(segment.nextTable.columnCount);
        spinnerGridNextRows.setValue(segment.nextTable.rowCount);
        dateLabel.setShowTime(checkBoxDate.isSelected());

        tfNextCaption.setText(segment.nextTable.caption);
        spinnerNextBorder.setValue(segment.nextTable.border);
        tfNextFont.setText(new Board.FontAdapter().marshal(segment.nextTable.font));
        tfNextFontColor.setText(new Board.ColorAdapter().marshal(segment.nextTable.fontColor));
    }

    /**
     * Загрузка параметров из XML ветки.
     * <pre>
     * Left visible="0" Размер="20">
     * Параметер Наименование="Бегущий текст" Тип="3" Значение=""/>
     * Параметер Наименование="Скорость бегущего текста" Тип="1" Значение="4"/>
     * Параметер Наименование="Размер шрифта" Тип="1" Значение="50"/>
     * Параметер Наименование="Цвет шрифта" Тип="1" Значение="222"/>
     * Параметер Наименование="Простая дата" Тип="4" Значение="0"/>
     * Параметер Наименование="Фоновое изображение" Тип="3" Значение="config/mainboard/1u.PNG"/>
     * Параметер Наименование="Видеофайл" Тип="3" Значение="D:/WORK/QSystem/config/mainboard/sezd17.mpg"/>
     * /Left>
     * </pre>
     *
     * @param params из нее грузим параметры
     */
    private void loadXML(Element params) {
        if (!Uses.elementsByAttr(params, Uses.TAG_BOARD_NAME, Uses.TAG_BOARD_FRACTAL).isEmpty()) {
            tfFRactal.setText(Uses.elementsByAttr(params, Uses.TAG_BOARD_NAME, Uses.TAG_BOARD_FRACTAL).get(0).attributeValue(Uses.TAG_BOARD_VALUE));
        } else {
            tfFRactal.setText("Do not touch this!");
        }
        textFieldRunning.setText(Uses.elementsByAttr(params, Uses.TAG_BOARD_NAME, Uses.TAG_BOARD_RUNNING_TEXT).get(0).attributeValue(Uses.TAG_BOARD_VALUE));
        textAreaHtml.setText(params.getText().trim());
        runningLabel.setRunningText(textFieldRunning.getText());
        htmlLabel.setText(textAreaHtml.getText().trim());
        textFieldPict.setText(Uses.elementsByAttr(params, Uses.TAG_BOARD_NAME, Uses.TAG_BOARD_FON_IMG).get(0).attributeValue(Uses.TAG_BOARD_VALUE));
        textFieldVideo.setText(Uses.elementsByAttr(params, Uses.TAG_BOARD_NAME, Uses.TAG_BOARD_VIDEO_FILE).get(0).attributeValue(Uses.TAG_BOARD_VALUE));
        spinnerFontSize.setValue(Integer.parseInt(Uses.elementsByAttr(params, Uses.TAG_BOARD_NAME, Uses.TAG_BOARD_FONT_SIZE).get(0).attributeValue(Uses.TAG_BOARD_VALUE)));
        textFieldFontColor.setText(Uses.elementsByAttr(params, Uses.TAG_BOARD_NAME, Uses.TAG_BOARD_FONT_COLOR).get(0).attributeValue(Uses.TAG_BOARD_VALUE));
        runningLabel.setFont(new Font(runningLabel.getFont().getFontName(), runningLabel.getFont().getStyle(), (Integer) spinnerFontSize.getValue()));
        runningLabel.setForeground(Color.decode("#" + textFieldFontColor.getText()));
        dateLabel.setFont(new Font(runningLabel.getFont().getFontName(), runningLabel.getFont().getStyle(), (Integer) spinnerFontSize.getValue()));
        dateLabel.setForeground(Color.decode("#" + textFieldFontColor.getText()));
        htmlLabel.setFont(new Font(runningLabel.getFont().getFontName(), runningLabel.getFont().getStyle(), (Integer) spinnerFontSize.getValue()));
        htmlLabel.setForeground(Color.decode("#" + textFieldFontColor.getText()));
        spinnerSpeed.setValue(Integer.parseInt(Uses.elementsByAttr(params, Uses.TAG_BOARD_NAME, Uses.TAG_BOARD_SPEED_TEXT).get(0).attributeValue(Uses.TAG_BOARD_VALUE)));
        runningLabel.setSpeedRunningText((Integer) spinnerSpeed.getValue());
        checkBoxDate.setSelected("1".equals(Uses.elementsByAttr(params, Uses.TAG_BOARD_NAME, Uses.TAG_BOARD_SIMPLE_DATE).get(0).attributeValue(Uses.TAG_BOARD_VALUE)));
        if (!Uses.elementsByAttr(params, Uses.TAG_BOARD_NAME, Uses.TAG_BOARD_GRID_NEXT).isEmpty()) {
            checkBoxGridNext.setSelected("1".equals(Uses.elementsByAttr(params, Uses.TAG_BOARD_NAME, Uses.TAG_BOARD_GRID_NEXT).get(0).attributeValue(Uses.TAG_BOARD_VALUE)));
            spinnerGridNextCols.setValue(Integer.parseInt(
                    Uses.elementsByAttr(params, Uses.TAG_BOARD_NAME, Uses.TAG_BOARD_GRID_NEXT_COLS).get(0).attributeValue(Uses.TAG_BOARD_VALUE)));
            spinnerGridNextRows.setValue(Integer.parseInt(
                    Uses.elementsByAttr(params, Uses.TAG_BOARD_NAME, Uses.TAG_BOARD_GRID_NEXT_ROWS).get(0).attributeValue(Uses.TAG_BOARD_VALUE)));
        } else {
            Element n = new DefaultElement(Uses.TAG_BOARD_PROP);
            n.addAttribute(Uses.TAG_BOARD_NAME, Uses.TAG_BOARD_GRID_NEXT);
            n.addAttribute(Uses.TAG_BOARD_TYPE, "" + Uses.BOARD_TYPE_BOOL);
            n.addAttribute(Uses.TAG_BOARD_VALUE, "0");
            params.add(n);

            n = new DefaultElement(Uses.TAG_BOARD_PROP);
            n.addAttribute(Uses.TAG_BOARD_NAME, Uses.TAG_BOARD_GRID_NEXT_COLS);
            n.addAttribute(Uses.TAG_BOARD_TYPE, "" + Uses.BOARD_TYPE_INT);
            n.addAttribute(Uses.TAG_BOARD_VALUE, "1");
            params.add(n);

            n = new DefaultElement(Uses.TAG_BOARD_PROP);
            n.addAttribute(Uses.TAG_BOARD_NAME, Uses.TAG_BOARD_GRID_NEXT_ROWS);
            n.addAttribute(Uses.TAG_BOARD_TYPE, "" + Uses.BOARD_TYPE_INT);
            n.addAttribute(Uses.TAG_BOARD_VALUE, "5");
            params.add(n);
        }
        dateLabel.setShowTime(checkBoxDate.isSelected());
        this.params = params;
    }

    /**
     * Сохраним измененные параметры в XML.
     */
    private void saveXML() {
        if (params != null) {
            if (!Uses.elementsByAttr(params, Uses.TAG_BOARD_NAME, Uses.TAG_BOARD_FRACTAL).isEmpty()) {
                Uses.elementsByAttr(params, Uses.TAG_BOARD_NAME, Uses.TAG_BOARD_FRACTAL).get(0).addAttribute(Uses.TAG_BOARD_VALUE, tfFRactal.getText());
            }
            Uses.elementsByAttr(params, Uses.TAG_BOARD_NAME, Uses.TAG_BOARD_RUNNING_TEXT).get(0).addAttribute(Uses.TAG_BOARD_VALUE, textFieldRunning.getText());
            Uses.elementsByAttr(params, Uses.TAG_BOARD_NAME, Uses.TAG_BOARD_FON_IMG).get(0).addAttribute(Uses.TAG_BOARD_VALUE, textFieldPict.getText());
            // удалить предыдущие узды CDATA
            for (int i = 0; i < params.nodeCount(); i++) {
                final Node node = params.node(i);
                if (node.getNodeType() == Node.CDATA_SECTION_NODE) {
                    params.remove(node);
                }
            }
            final String str = textAreaHtml.getText();
            if (!"".equals(str)) {
                params.addCDATA(str);
            }
            Uses.elementsByAttr(params, Uses.TAG_BOARD_NAME, Uses.TAG_BOARD_VIDEO_FILE).get(0).addAttribute(Uses.TAG_BOARD_VALUE, textFieldVideo.getText());
            Uses.elementsByAttr(params, Uses.TAG_BOARD_NAME, Uses.TAG_BOARD_FONT_SIZE).get(0)
                    .addAttribute(Uses.TAG_BOARD_VALUE, String.valueOf((Integer) spinnerFontSize.getValue()));
            Uses.elementsByAttr(params, Uses.TAG_BOARD_NAME, Uses.TAG_BOARD_SPEED_TEXT).get(0)
                    .addAttribute(Uses.TAG_BOARD_VALUE, String.valueOf((Integer) spinnerSpeed.getValue()));
            Uses.elementsByAttr(params, Uses.TAG_BOARD_NAME, Uses.TAG_BOARD_FONT_COLOR).get(0).addAttribute(Uses.TAG_BOARD_VALUE, textFieldFontColor.getText());
            Uses.elementsByAttr(params, Uses.TAG_BOARD_NAME, Uses.TAG_BOARD_SIMPLE_DATE).get(0).addAttribute(Uses.TAG_BOARD_VALUE, checkBoxDate.isSelected() ? "1" : "0");
            Uses.elementsByAttr(params, Uses.TAG_BOARD_NAME, Uses.TAG_BOARD_GRID_NEXT).get(0).addAttribute(Uses.TAG_BOARD_VALUE, checkBoxGridNext.isSelected() ? "1" : "0");
            Uses.elementsByAttr(params, Uses.TAG_BOARD_NAME, Uses.TAG_BOARD_GRID_NEXT_COLS).get(0)
                    .addAttribute(Uses.TAG_BOARD_VALUE, String.valueOf((Integer) spinnerGridNextCols.getValue()));
            Uses.elementsByAttr(params, Uses.TAG_BOARD_NAME, Uses.TAG_BOARD_GRID_NEXT_ROWS).get(0)
                    .addAttribute(Uses.TAG_BOARD_VALUE, String.valueOf((Integer) spinnerGridNextRows.getValue()));
        }
        if (segment != null) {
            saveSegment();
        }
    }

    private void saveSegment() {
        if (!segment.fractal.isEmpty()) {
            segment.fractal = tfFRactal.getText();
        }
        segment.runningText = textFieldRunning.getText();
        segment.backgroundImg = textFieldPict.getText();
        segment.content = textAreaHtml.getText();
        segment.videoFile = textFieldVideo.getText();
        segment.simpleDate = checkBoxDate.isSelected();
        segment.speedRunningText = (Integer) spinnerSpeed.getValue();
        segment.font = new Font(segment.font.getName(), segment.font.getStyle(), (Integer) spinnerFontSize.getValue());
        segment.nextTable.font = segment.font;
        segment.fontColor = Color.decode("#" + textFieldFontColor.getText());
        segment.nextTable.fontColor = segment.fontColor;
        segment.nextTable.visible = checkBoxGridNext.isSelected();
        segment.nextTable.columnCount = (Integer) spinnerGridNextCols.getValue();
        segment.nextTable.rowCount = (Integer) spinnerGridNextRows.getValue();

        segment.nextTable.caption = tfNextCaption.getText();
        segment.nextTable.border = (Integer) spinnerNextBorder.getValue();
        segment.nextTable.font = new Board.FontAdapter().unmarshal(tfNextFont.getText());
        segment.nextTable.fontColor = new Board.ColorAdapter().unmarshal(tfNextFontColor.getText());
    }

    /**
     * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    // Generated using JFormDesigner non-commercial license
    private void initComponents() {
        ResourceBundle bundle = ResourceBundle.getBundle("ru.apertum.qsystem.client.forms.resources.FBoardParams");
        buttonOk = new JButton();
        buttonCancel = new JButton();
        tfFRactal = new JTextField();
        jLabel10 = new JLabel();
        tabbedPaneContent = new JTabbedPane();
        panelRunningText = new JPanel();
        jLabel2 = new JLabel();
        textFieldRunning = new JTextField();
        jLabel4 = new JLabel();
        spinnerSpeed = new JSpinner();
        buttonRun = new JToggleButton();
        buttonRefreshRunningText = new JButton();
        runningLabel = new RunningLabel();
        panelContent = new JPanel();
        checkBoxDate = new JCheckBox();
        jLabel7 = new JLabel();
        spinnerFontSize = new JSpinner();
        jLabel8 = new JLabel();
        textFieldFontColor = new JTextField();
        buttonColor = new JButton();
        jLabel5 = new JLabel();
        textFieldPict = new JTextField();
        jLabel6 = new JLabel();
        textFieldVideo = new JTextField();
        dateLabel = new RunningLabel();
        panelHtmlText = new JPanel();
        jLabel1 = new JLabel();
        jScrollPane1 = new JScrollPane();
        textAreaHtml = new JTextArea();
        jScrollPane2 = new JScrollPane();
        htmlLabel = new RunningLabel();
        panelNextTable = new JPanel();
        checkBoxGridNext = new JCheckBox();
        jLabel3 = new JLabel();
        spinnerGridNextCols = new JSpinner();
        jLabel9 = new JLabel();
        spinnerGridNextRows = new JSpinner();
        labelNextCaption = new JLabel();
        tfNextCaption = new JTextField();
        labelNextBorder = new JLabel();
        spinnerNextBorder = new JSpinner();
        labelNextFont = new JLabel();
        tfNextFont = new JTextField();
        label1 = new JLabel();
        labelNextFontColor = new JLabel();
        tfNextFontColor = new JTextField();
        label2 = new JLabel();

        //======== this ========
        setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
        setName("Form");
        var contentPane = getContentPane();

        //---- buttonOk ----
        buttonOk.setText(bundle.getString("buttonOk.text"));
        buttonOk.setName("buttonOk");

        //---- buttonCancel ----
        buttonCancel.setText(bundle.getString("buttonCancel.text"));
        buttonCancel.setName("buttonCancel");

        //---- tfFRactal ----
        tfFRactal.setText(bundle.getString("tfFRactal.text"));
        tfFRactal.setName("tfFRactal");

        //---- jLabel10 ----
        jLabel10.setText(bundle.getString("jLabel10.text"));
        jLabel10.setName("jLabel10");

        //======== tabbedPaneContent ========
        {
            tabbedPaneContent.setName("tabbedPaneContent");

            //======== panelRunningText ========
            {
                panelRunningText.setName("panelRunningText");

                //---- jLabel2 ----
                jLabel2.setText(bundle.getString("jLabel2.text"));
                jLabel2.setName("jLabel2");

                //---- textFieldRunning ----
                textFieldRunning.setText(bundle.getString("textFieldRunning.text"));
                textFieldRunning.setName("textFieldRunning");
                textFieldRunning.addKeyListener(new KeyAdapter() {
                    @Override
                    public void keyReleased(KeyEvent e) {
                        textFieldRunningKeyReleased(e);
                    }
                });

                //---- jLabel4 ----
                jLabel4.setText(bundle.getString("jLabel4.text"));
                jLabel4.setName("jLabel4");

                //---- spinnerSpeed ----
                spinnerSpeed.setValue(10);
                spinnerSpeed.setName("spinnerSpeed");

                //---- buttonRun ----
                buttonRun.setText(bundle.getString("buttonRun.text"));
                buttonRun.setName("buttonRun");
                buttonRun.addActionListener(e -> buttonRunActionPerformed(e));

                //---- buttonRefreshRunningText ----
                buttonRefreshRunningText.setText(bundle.getString("buttonRefreshRunningText.text"));
                buttonRefreshRunningText.setName("buttonRefreshRunningText");
                buttonRefreshRunningText.addActionListener(e -> buttonRefreshRunningTextActionPerformed(e));

                //---- runningLabel ----
                runningLabel.setHorizontalAlignment(SwingConstants.CENTER);
                runningLabel.setText(bundle.getString("FBoardParams.runningLabel.text"));
                runningLabel.setName("runningLabel");

                GroupLayout panelRunningTextLayout = new GroupLayout(panelRunningText);
                panelRunningText.setLayout(panelRunningTextLayout);
                panelRunningTextLayout.setHorizontalGroup(
                    panelRunningTextLayout.createParallelGroup()
                        .addGroup(panelRunningTextLayout.createSequentialGroup()
                            .addContainerGap()
                            .addGroup(panelRunningTextLayout.createParallelGroup()
                                .addGroup(panelRunningTextLayout.createSequentialGroup()
                                    .addComponent(jLabel2)
                                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(textFieldRunning, GroupLayout.DEFAULT_SIZE, 1, Short.MAX_VALUE))
                                .addGroup(panelRunningTextLayout.createSequentialGroup()
                                    .addComponent(jLabel4)
                                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(spinnerSpeed, GroupLayout.PREFERRED_SIZE, 60, GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 483, Short.MAX_VALUE)
                                    .addComponent(buttonRefreshRunningText)
                                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(buttonRun))
                                .addComponent(runningLabel, GroupLayout.DEFAULT_SIZE, 824, Short.MAX_VALUE))
                            .addContainerGap())
                );
                panelRunningTextLayout.setVerticalGroup(
                    panelRunningTextLayout.createParallelGroup()
                        .addGroup(panelRunningTextLayout.createSequentialGroup()
                            .addContainerGap()
                            .addGroup(panelRunningTextLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel2)
                                .addComponent(textFieldRunning, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
                            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                            .addGroup(panelRunningTextLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel4)
                                .addComponent(spinnerSpeed, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                                .addComponent(buttonRun)
                                .addComponent(buttonRefreshRunningText))
                            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(runningLabel, GroupLayout.DEFAULT_SIZE, 263, Short.MAX_VALUE)
                            .addContainerGap())
                );
            }
            tabbedPaneContent.addTab(bundle.getString("jLabel2.text"), panelRunningText);

            //======== panelContent ========
            {
                panelContent.setName("panelContent");

                //---- checkBoxDate ----
                checkBoxDate.setText(bundle.getString("checkBoxDate.text"));
                checkBoxDate.setName("checkBoxDate");
                checkBoxDate.addActionListener(e -> checkBoxDateActionPerformed(e));

                //---- jLabel7 ----
                jLabel7.setText(bundle.getString("jLabel7.text"));
                jLabel7.setName("jLabel7");

                //---- spinnerFontSize ----
                spinnerFontSize.setValue(20);
                spinnerFontSize.setName("spinnerFontSize");

                //---- jLabel8 ----
                jLabel8.setText(bundle.getString("jLabel8.text"));
                jLabel8.setName("jLabel8");

                //---- textFieldFontColor ----
                textFieldFontColor.setText(bundle.getString("textFieldFontColor.text"));
                textFieldFontColor.setName("textFieldFontColor");

                //---- buttonColor ----
                buttonColor.setText(bundle.getString("buttonColor.text"));
                buttonColor.setName("buttonColor");
                buttonColor.addActionListener(e -> buttonColorActionPerformed(e));

                //---- jLabel5 ----
                jLabel5.setText(bundle.getString("jLabel5.text"));
                jLabel5.setName("jLabel5");

                //---- textFieldPict ----
                textFieldPict.setText(bundle.getString("textFieldPict.text"));
                textFieldPict.setName("textFieldPict");

                //---- jLabel6 ----
                jLabel6.setText(bundle.getString("jLabel6.text"));
                jLabel6.setName("jLabel6");

                //---- textFieldVideo ----
                textFieldVideo.setText(bundle.getString("textFieldVideo.text"));
                textFieldVideo.setName("textFieldVideo");

                //---- dateLabel ----
                dateLabel.setHorizontalAlignment(SwingConstants.CENTER);
                dateLabel.setText(bundle.getString("FBoardParams.dateLabel.text"));
                dateLabel.setName("runningLabel");

                GroupLayout panelContentLayout = new GroupLayout(panelContent);
                panelContent.setLayout(panelContentLayout);
                panelContentLayout.setHorizontalGroup(
                    panelContentLayout.createParallelGroup()
                        .addGroup(panelContentLayout.createSequentialGroup()
                            .addContainerGap()
                            .addGroup(panelContentLayout.createParallelGroup()
                                .addGroup(panelContentLayout.createSequentialGroup()
                                    .addComponent(jLabel5)
                                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(textFieldPict, GroupLayout.DEFAULT_SIZE, 1, Short.MAX_VALUE))
                                .addGroup(panelContentLayout.createSequentialGroup()
                                    .addComponent(jLabel6)
                                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(textFieldVideo, GroupLayout.DEFAULT_SIZE, 756, Short.MAX_VALUE))
                                .addGroup(panelContentLayout.createSequentialGroup()
                                    .addGroup(panelContentLayout.createParallelGroup()
                                        .addComponent(checkBoxDate)
                                        .addGroup(panelContentLayout.createSequentialGroup()
                                            .addComponent(jLabel7)
                                            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(spinnerFontSize, GroupLayout.PREFERRED_SIZE, 75, GroupLayout.PREFERRED_SIZE)
                                            .addGap(18, 18, 18)
                                            .addComponent(jLabel8)
                                            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(textFieldFontColor, GroupLayout.PREFERRED_SIZE, 77, GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(buttonColor)))
                                    .addGap(0, 396, Short.MAX_VALUE))
                                .addComponent(dateLabel, GroupLayout.DEFAULT_SIZE, 824, Short.MAX_VALUE))
                            .addContainerGap())
                );
                panelContentLayout.setVerticalGroup(
                    panelContentLayout.createParallelGroup()
                        .addGroup(panelContentLayout.createSequentialGroup()
                            .addContainerGap()
                            .addComponent(checkBoxDate)
                            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                            .addGroup(panelContentLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel7)
                                .addComponent(spinnerFontSize, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLabel8)
                                .addComponent(textFieldFontColor, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                                .addComponent(buttonColor))
                            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                            .addGroup(panelContentLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel5)
                                .addComponent(textFieldPict, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
                            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                            .addGroup(panelContentLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel6)
                                .addComponent(textFieldVideo, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
                            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(dateLabel, GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE)
                            .addContainerGap())
                );
            }
            tabbedPaneContent.addTab("Content", panelContent);

            //======== panelHtmlText ========
            {
                panelHtmlText.setName("panelHtmlText");

                //---- jLabel1 ----
                jLabel1.setText(bundle.getString("jLabel1.text"));
                jLabel1.setName("jLabel1");

                //======== jScrollPane1 ========
                {
                    jScrollPane1.setName("jScrollPane1");

                    //---- textAreaHtml ----
                    textAreaHtml.setColumns(20);
                    textAreaHtml.setLineWrap(true);
                    textAreaHtml.setRows(5);
                    textAreaHtml.setWrapStyleWord(true);
                    textAreaHtml.setName("textAreaHtml");
                    textAreaHtml.addKeyListener(new KeyAdapter() {
                        @Override
                        public void keyReleased(KeyEvent e) {
                            textAreaHtmlKeyReleased(e);
                        }
                    });
                    jScrollPane1.setViewportView(textAreaHtml);
                }

                //======== jScrollPane2 ========
                {
                    jScrollPane2.setName("jScrollPane2");

                    //---- htmlLabel ----
                    htmlLabel.setHorizontalAlignment(SwingConstants.CENTER);
                    htmlLabel.setText(bundle.getString("htmlLabel.text"));
                    htmlLabel.setName("runningLabel");
                    jScrollPane2.setViewportView(htmlLabel);
                }

                GroupLayout panelHtmlTextLayout = new GroupLayout(panelHtmlText);
                panelHtmlText.setLayout(panelHtmlTextLayout);
                panelHtmlTextLayout.setHorizontalGroup(
                    panelHtmlTextLayout.createParallelGroup()
                        .addGroup(panelHtmlTextLayout.createSequentialGroup()
                            .addContainerGap()
                            .addGroup(panelHtmlTextLayout.createParallelGroup()
                                .addGroup(panelHtmlTextLayout.createSequentialGroup()
                                    .addComponent(jLabel1)
                                    .addGap(0, 758, Short.MAX_VALUE))
                                .addComponent(jScrollPane2)
                                .addComponent(jScrollPane1, GroupLayout.DEFAULT_SIZE, 824, Short.MAX_VALUE))
                            .addContainerGap())
                );
                panelHtmlTextLayout.setVerticalGroup(
                    panelHtmlTextLayout.createParallelGroup()
                        .addGroup(panelHtmlTextLayout.createSequentialGroup()
                            .addContainerGap()
                            .addComponent(jLabel1)
                            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jScrollPane1, GroupLayout.PREFERRED_SIZE, 159, GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jScrollPane2, GroupLayout.DEFAULT_SIZE, 148, Short.MAX_VALUE)
                            .addContainerGap())
                );
            }
            tabbedPaneContent.addTab(bundle.getString("jLabel1.text"), panelHtmlText);

            //======== panelNextTable ========
            {
                panelNextTable.setName("panelNextTable");

                //---- checkBoxGridNext ----
                checkBoxGridNext.setText(bundle.getString("checkBoxGridNext.text"));
                checkBoxGridNext.setName("checkBoxGridNext");
                checkBoxGridNext.addActionListener(e -> checkBoxGridNextActionPerformed(e));

                //---- jLabel3 ----
                jLabel3.setText(bundle.getString("jLabel3.text"));
                jLabel3.setName("jLabel3");

                //---- spinnerGridNextCols ----
                spinnerGridNextCols.setModel(new SpinnerNumberModel(1, 1, 10, 1));
                spinnerGridNextCols.setName("spinnerGridNextCols");

                //---- jLabel9 ----
                jLabel9.setText(bundle.getString("jLabel9.text"));
                jLabel9.setName("jLabel9");

                //---- spinnerGridNextRows ----
                spinnerGridNextRows.setModel(new SpinnerNumberModel(1, 1, 10, 1));
                spinnerGridNextRows.setName("spinnerGridNextRows");

                //---- labelNextCaption ----
                labelNextCaption.setText("nextTable.caption");
                labelNextCaption.setName("labelNextCaption");

                //---- tfNextCaption ----
                tfNextCaption.setName("tfNextCaption");

                //---- labelNextBorder ----
                labelNextBorder.setText("nextTable.border");
                labelNextBorder.setName("labelNextBorder");

                //---- spinnerNextBorder ----
                spinnerNextBorder.setModel(new SpinnerNumberModel(0, 0, 10, 1));
                spinnerNextBorder.setName("spinnerNextBorder");

                //---- labelNextFont ----
                labelNextFont.setText("nextTable.font");
                labelNextFont.setName("labelNextFont");

                //---- tfNextFont ----
                tfNextFont.setName("tfNextFont");

                //---- label1 ----
                label1.setText("(for ex. \"Arial-plain-14\")");
                label1.setName("label1");

                //---- labelNextFontColor ----
                labelNextFontColor.setText("nextTable.fontColor");
                labelNextFontColor.setName("labelNextFontColor");

                //---- tfNextFontColor ----
                tfNextFontColor.setName("tfNextFontColor");

                //---- label2 ----
                label2.setText("(for ex. \"#AADD15\")");
                label2.setName("label2");

                GroupLayout panelNextTableLayout = new GroupLayout(panelNextTable);
                panelNextTable.setLayout(panelNextTableLayout);
                panelNextTableLayout.setHorizontalGroup(
                    panelNextTableLayout.createParallelGroup()
                        .addGroup(panelNextTableLayout.createSequentialGroup()
                            .addContainerGap()
                            .addGroup(panelNextTableLayout.createParallelGroup()
                                .addGroup(panelNextTableLayout.createSequentialGroup()
                                    .addComponent(labelNextCaption)
                                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(tfNextCaption, GroupLayout.DEFAULT_SIZE, 724, Short.MAX_VALUE))
                                .addGroup(panelNextTableLayout.createSequentialGroup()
                                    .addGroup(panelNextTableLayout.createParallelGroup()
                                        .addComponent(checkBoxGridNext)
                                        .addGroup(panelNextTableLayout.createSequentialGroup()
                                            .addComponent(jLabel3)
                                            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(spinnerGridNextCols, GroupLayout.PREFERRED_SIZE, 50, GroupLayout.PREFERRED_SIZE)
                                            .addGap(18, 18, 18)
                                            .addComponent(jLabel9)
                                            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(spinnerGridNextRows, GroupLayout.PREFERRED_SIZE, 48, GroupLayout.PREFERRED_SIZE))
                                        .addGroup(panelNextTableLayout.createSequentialGroup()
                                            .addComponent(labelNextBorder)
                                            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(spinnerNextBorder, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
                                        .addGroup(panelNextTableLayout.createSequentialGroup()
                                            .addComponent(labelNextFontColor)
                                            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(tfNextFontColor, GroupLayout.PREFERRED_SIZE, 91, GroupLayout.PREFERRED_SIZE)
                                            .addGap(18, 18, 18)
                                            .addComponent(label2))
                                        .addGroup(panelNextTableLayout.createSequentialGroup()
                                            .addComponent(labelNextFont)
                                            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(tfNextFont, GroupLayout.PREFERRED_SIZE, 165, GroupLayout.PREFERRED_SIZE)
                                            .addGap(18, 18, 18)
                                            .addComponent(label1)))
                                    .addGap(0, 433, Short.MAX_VALUE)))
                            .addContainerGap())
                );
                panelNextTableLayout.setVerticalGroup(
                    panelNextTableLayout.createParallelGroup()
                        .addGroup(panelNextTableLayout.createSequentialGroup()
                            .addContainerGap()
                            .addComponent(checkBoxGridNext)
                            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                            .addGroup(panelNextTableLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel3)
                                .addComponent(spinnerGridNextCols, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLabel9)
                                .addComponent(spinnerGridNextRows, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
                            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                            .addGroup(panelNextTableLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                                .addComponent(labelNextCaption)
                                .addComponent(tfNextCaption, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
                            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                            .addGroup(panelNextTableLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                                .addComponent(labelNextBorder)
                                .addComponent(spinnerNextBorder, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
                            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                            .addGroup(panelNextTableLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                                .addComponent(labelNextFont)
                                .addComponent(tfNextFont, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                                .addComponent(label1))
                            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                            .addGroup(panelNextTableLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                                .addComponent(labelNextFontColor)
                                .addComponent(tfNextFontColor, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                                .addComponent(label2))
                            .addContainerGap(140, Short.MAX_VALUE))
                );
            }
            tabbedPaneContent.addTab(bundle.getString("checkBoxGridNext.text"), panelNextTable);
        }

        GroupLayout contentPaneLayout = new GroupLayout(contentPane);
        contentPane.setLayout(contentPaneLayout);
        contentPaneLayout.setHorizontalGroup(
            contentPaneLayout.createParallelGroup()
                .addGroup(contentPaneLayout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(contentPaneLayout.createParallelGroup()
                        .addGroup(contentPaneLayout.createSequentialGroup()
                            .addComponent(jLabel10)
                            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(tfFRactal))
                        .addGroup(GroupLayout.Alignment.TRAILING, contentPaneLayout.createSequentialGroup()
                            .addGap(0, 0, Short.MAX_VALUE)
                            .addComponent(buttonOk)
                            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(buttonCancel, GroupLayout.PREFERRED_SIZE, 89, GroupLayout.PREFERRED_SIZE))
                        .addComponent(tabbedPaneContent, GroupLayout.Alignment.TRAILING))
                    .addContainerGap())
        );
        contentPaneLayout.setVerticalGroup(
            contentPaneLayout.createParallelGroup()
                .addGroup(GroupLayout.Alignment.TRAILING, contentPaneLayout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(contentPaneLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                        .addComponent(tfFRactal, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel10))
                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(tabbedPaneContent)
                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(contentPaneLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                        .addComponent(buttonOk)
                        .addComponent(buttonCancel))
                    .addContainerGap())
        );
        pack();
        setLocationRelativeTo(getOwner());
    }// </editor-fold>//GEN-END:initComponents

    private void textFieldRunningKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_textFieldRunningKeyReleased
        //runningLabel.stop()
        //runningLabel.setRunningText(textFieldRunning.getText())
    }//GEN-LAST:event_textFieldRunningKeyReleased

    private void buttonRunActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonRunActionPerformed

        if (buttonRun.isSelected()) {
            runningLabel.setRunningText(textFieldRunning.getText());
            runningLabel.start();
            buttonRun.setText(getLocaleMessage("dialog.stop"));
        } else {
            runningLabel.stop();
            buttonRun.setText(getLocaleMessage("dialog.start"));
        }
    }//GEN-LAST:event_buttonRunActionPerformed

    private void checkBoxDateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_checkBoxDateActionPerformed

        dateLabel.setShowTime(checkBoxDate.isSelected());
        if (checkBoxDate.isSelected()) {
            checkBoxGridNext.setSelected(!checkBoxDate.isSelected());
        }
    }//GEN-LAST:event_checkBoxDateActionPerformed

    private void buttonColorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonColorActionPerformed

        final JDialog di = new JDialog(this, true);
        di.setTitle(getLocaleMessage("dialog.select_color"));
        final JColorChooser cc = new JColorChooser(Color.decode("#" + textFieldFontColor.getText()));
        di.setSize(450, 440);
        LayoutManager layout = new FlowLayout(2, 10, 10);
        di.setLayout(layout);
        di.add(cc);
        final JButton but = new JButton(new AbstractAction() {

            @Override
            public void actionPerformed(ActionEvent e) {
                textFieldFontColor.setText(Integer.toHexString(cc.getColor().getRGB()).substring(2).toUpperCase());
                runningLabel.setForeground(Color.decode("#" + textFieldFontColor.getText()));
                htmlLabel.setForeground(Color.decode("#" + textFieldFontColor.getText()));
                dateLabel.setForeground(Color.decode("#" + textFieldFontColor.getText()));
                di.setVisible(false);
            }
        });
        but.setText(getLocaleMessage("dialog.select"));
        but.setSize(20, 20);
        di.add(but);
        Uses.setLocation(di);
        di.setVisible(true);
    }//GEN-LAST:event_buttonColorActionPerformed

    private void textAreaHtmlKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_textAreaHtmlKeyReleased
        htmlLabel.setText(textAreaHtml.getText());
    }//GEN-LAST:event_textAreaHtmlKeyReleased

    private void buttonRefreshRunningTextActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonRefreshRunningTextActionPerformed
        if (!textFieldRunning.getText().isEmpty() && netProps != null) {
            NetCommander.setRunningText(netProps, textFieldRunning.getText(), segment == null ? params.getName() : segment.getLocation());
            JOptionPane.showMessageDialog(this,
                    "Running label text was updated successfully.",
                    "Mainboard updating",
                    JOptionPane.PLAIN_MESSAGE);
        }
    }//GEN-LAST:event_buttonRefreshRunningTextActionPerformed

    private void checkBoxGridNextActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_checkBoxGridNextActionPerformed
        if (checkBoxGridNext.isSelected()) {
            checkBoxDate.setSelected(!checkBoxGridNext.isSelected());
        }
    }//GEN-LAST:event_checkBoxGridNextActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    // Generated using JFormDesigner non-commercial license
    private JButton buttonOk;
    private JButton buttonCancel;
    private JTextField tfFRactal;
    private JLabel jLabel10;
    private JTabbedPane tabbedPaneContent;
    private JPanel panelRunningText;
    private JLabel jLabel2;
    private JTextField textFieldRunning;
    private JLabel jLabel4;
    private JSpinner spinnerSpeed;
    private JToggleButton buttonRun;
    private JButton buttonRefreshRunningText;
    private RunningLabel runningLabel;
    private JPanel panelContent;
    private JCheckBox checkBoxDate;
    private JLabel jLabel7;
    private JSpinner spinnerFontSize;
    private JLabel jLabel8;
    private JTextField textFieldFontColor;
    private JButton buttonColor;
    private JLabel jLabel5;
    private JTextField textFieldPict;
    private JLabel jLabel6;
    private JTextField textFieldVideo;
    private RunningLabel dateLabel;
    private JPanel panelHtmlText;
    private JLabel jLabel1;
    private JScrollPane jScrollPane1;
    private JTextArea textAreaHtml;
    private JScrollPane jScrollPane2;
    private RunningLabel htmlLabel;
    private JPanel panelNextTable;
    private JCheckBox checkBoxGridNext;
    private JLabel jLabel3;
    private JSpinner spinnerGridNextCols;
    private JLabel jLabel9;
    private JSpinner spinnerGridNextRows;
    private JLabel labelNextCaption;
    private JTextField tfNextCaption;
    private JLabel labelNextBorder;
    private JSpinner spinnerNextBorder;
    private JLabel labelNextFont;
    private JTextField tfNextFont;
    private JLabel label1;
    private JLabel labelNextFontColor;
    private JTextField tfNextFontColor;
    private JLabel label2;
    // End of variables declaration//GEN-END:variables
}
